
# 1 定义master类 init方法 make_cake方法
class Master(object):
    def __init__(self):
        self.kongfu = '[传统方法]'
        pass

    def make_cake(self):
        print(f'使用{self.kongfu}摊煎饼')
        pass


# 2 定义HeimaSchool类 /kongfu /make_cake
class HeimaSchool(object):
    def __init__(self):
        self.kongfu = '[黑马配方]'
        pass

    def make_cake(self):
        print(f'使用{self.kongfu}摊煎饼')
        pass


# 3 定义徒弟类 继承Master HeimaSchool
class Prentice(Master, HeimaSchool):
    def __init__(self):
        self.kongfu = '[独创摊煎饼技术]'
        pass

    def make_cake(self):
        print(f'使用{self.kongfu}摊煎饼')
        pass

    # 通过父类名.方法名(self)来调用父类的方法
    def make_master_cake(self):
        Master.__init__(self)
        Master.make_cake(self)
        pass


    def make_school_cake(self):
        HeimaSchool.__init__(self)
        HeimaSchool.make_cake(self)
        pass


# 4 徒孙类 继承徒弟类
class Tusun(Prentice):
    pass


if __name__ == '__main__':

    # 1 实例化 徒孙类对象
    mytusun01 = Tusun()

    # 2 调用各种煎饼果子方法
    mytusun01.make_cake()
    mytusun01.make_master_cake()
    mytusun01.make_school_cake()

    print('多层继承 End')





